package com.ldcc.report_system.api;

import com.ldcc.report_system.api.param.WeekReportParam;
import com.ldcc.report_system.api.results.PageResult;
import com.ldcc.report_system.api.results.WeekReportResult;
import com.ldcc.report_system.util.http.ServerResponse;

import java.util.List;

import retrofit2.http.Body;
import retrofit2.http.DELETE;
import retrofit2.http.GET;
import retrofit2.http.POST;
import retrofit2.http.PUT;
import retrofit2.http.Path;
import rx.Observable;

/**
 * @author wwj[yeshengkele@outlook.com]
 * @description 周报接口
 */
public interface WeekReportApi {

    /**
     * 添加日报
     *
     * @param param 日报实体
     */
    @POST("/report/week/")
    Observable<ServerResponse<Object>> save(@Body WeekReportParam param);

    @GET("/report/week/{id}")
    Observable<ServerResponse<WeekReportResult>> getById(@Path("id") String id);

    /**
     * 查询周报分页列表
     * @param currentPage 当前页
     * @return 周报分页列表
     */
    @GET("/report/week/page/{currentPage}")
    Observable<ServerResponse<PageResult<WeekReportResult>>> get(@Path("currentPage") long currentPage);

    @PUT("/report/week/")
    Observable<ServerResponse<Object>> update(@Body WeekReportParam weekReport);

    @DELETE("/report/week/{id}")
    Observable<ServerResponse<Object>> remove(@Path("id") String id);
}
